#include"ScriptGenerator.h" 

ScriptGenerator::ScriptGenerator(QWidget *parent):QDialog(parent){
    init();
}

void ScriptGenerator::init(){
    m_script = 0;
    m_scriptUsed = false;
    m_layout = new QFormLayout(this);
    setLayout(m_layout);

    m_editLink = new QLineEdit(this);
    m_editLink->setToolTip("www.trinitycore.info / only use this if you know what you are doing.");
    m_layout->addRow("Link: ", m_editLink);
    m_editLink->setValidator(new QIntValidator(this));
    m_editLink->setText("0");

    m_editPhaseMask = new QLineEdit(this);
    m_editPhaseMask->setToolTip("www.trinitycore.info / only use this if you know what you are doing.");
    m_layout->addRow("Phase Mask: ", m_editPhaseMask);
    m_editPhaseMask->setValidator(new QIntValidator(this));
    m_editPhaseMask->setText("0");

    m_editChance = new QLineEdit(this);
    m_editChance->setToolTip("Ranges from -100.0 (quests) through 0 (special, check the docs) to 100.0 (normal loot)");
    m_layout->addRow("Event Chance: ", m_editChance);
    m_editChance->setValidator(new QDoubleValidator(this));
    m_editChance->setText("100.0");

    m_eventFlagsWidget = new QWidget(this);
    m_eventFlagsWidget->setToolTip("Again, check www.trinitycore.info if in doubt. Do not use Debug.");
    m_layout->addRow("Event Flags: ", m_eventFlagsWidget);

    m_eventFlagsLayout = new QHBoxLayout(m_eventFlagsWidget);
    m_eventFlagsWidget->setLayout(m_eventFlagsLayout);

    m_checkRepeat = new QCheckBox("Cannot Repeat", m_eventFlagsWidget);
    m_check0 = new QCheckBox("Normal dungeon", m_eventFlagsWidget);
    m_check1 = new QCheckBox("Heroic dungeon", m_eventFlagsWidget);
    m_check2 = new QCheckBox("Normal raid", m_eventFlagsWidget);
    m_check3 = new QCheckBox("Heroic raid", m_eventFlagsWidget);
    m_checkDebug = new QCheckBox("Debug only", m_eventFlagsWidget);
    m_eventFlagsLayout->addWidget(m_checkRepeat);
    m_eventFlagsLayout->addWidget(m_check0);
    m_eventFlagsLayout->addWidget(m_check1);
    m_eventFlagsLayout->addWidget(m_check2);
    m_eventFlagsLayout->addWidget(m_check3);
    m_eventFlagsLayout->addWidget(m_checkDebug);

    m_comboEventType = new QComboBox(this);
    m_layout->addRow("Event Type: ", m_comboEventType);
    m_comboEventType->addItem("Timer In Combat");
    m_comboEventType->addItem("Timer Out Of Combat");
    m_comboEventType->addItem("Health Percent");
    m_comboEventType->addItem("Mana Percent");
    m_comboEventType->addItem("Aggro");
    m_comboEventType->addItem("Kill");
    m_comboEventType->addItem("Death");
    m_comboEventType->addItem("Evade");
    m_comboEventType->addItem("Spellhit");
    m_comboEventType->addItem("Range");
    m_comboEventType->addItem("Out of Combat LOS");
    m_comboEventType->addItem("Respawn");
    m_comboEventType->addItem("Target Health Percent");
    m_comboEventType->addItem("Target Casting");
    m_comboEventType->addItem("Friendly Health");
    m_comboEventType->addItem("Friendly Is CC");
    m_comboEventType->addItem("Friendly Missing Buff");
    m_comboEventType->addItem("Summoned Unit");
    m_comboEventType->addItem("Target Mana Percent");
    m_comboEventType->addItem("Accepted Quest");
    m_comboEventType->addItem("Reward Quest");
    m_comboEventType->addItem("Reached Home");
    m_comboEventType->addItem("Receive Emote");
    m_comboEventType->addItem("Has Aura");
    m_comboEventType->addItem("Target Buffed");
    m_comboEventType->addItem("Reset");
    m_comboEventType->addItem("In Combat LOS");
    m_comboEventType->addItem("Passenger Boarded");
    m_comboEventType->addItem("Passenger Removed");
    m_comboEventType->addItem("Charmed");
    m_comboEventType->addItem("Charmed Target");
    m_comboEventType->addItem("Spellhit Target");
    m_comboEventType->addItem("Damaged");
    m_comboEventType->addItem("Damaged Target");
    m_comboEventType->addItem("Movement Inform");
    m_comboEventType->addItem("Summon Despawned");
    m_comboEventType->addItem("Corpse Removed");
    m_comboEventType->addItem("AI Init");
    m_comboEventType->addItem("Data Set");
    m_comboEventType->addItem("Waypoint Start");
    m_comboEventType->addItem("Waypoint Reached");
    m_comboEventType->addItem("Transport Addplayer");
    m_comboEventType->addItem("Transport Addcreature");
    m_comboEventType->addItem("Transport Removeplayer");
    m_comboEventType->addItem("Transport Relocate");
    m_comboEventType->addItem("Instance Player Enter");
    m_comboEventType->addItem("Areatrigger Ontrigger");
    m_comboEventType->addItem("Quest Accepted");
    m_comboEventType->addItem("Quest Objective Completion");
    m_comboEventType->addItem("Quest Rewarded");
    m_comboEventType->addItem("Quest Fail");
    m_comboEventType->addItem("Text Over");
    m_comboEventType->addItem("Receive Heal");
    m_comboEventType->addItem("Just Summoned");
    m_comboEventType->addItem("Waypoint Paused");
    m_comboEventType->addItem("Waypoint Resumed");
    m_comboEventType->addItem("Waypoint Stopped");
    m_comboEventType->addItem("Waypoint Ended");
    m_comboEventType->addItem("Timed Event Triggered");
    m_comboEventType->addItem("Update");
    m_comboEventType->addItem("Link");
    m_comboEventType->addItem("Gossip Select");
    m_comboEventType->addItem("Just Created");
    m_comboEventType->addItem("Gossip Hello");
    m_comboEventType->addItem("Follow Completed");
    m_comboEventType->addItem("Dummy Effect");
    m_comboEventType->addItem("Is Behind Target");
    m_comboEventType->addItem("Game Event Start");
    m_comboEventType->addItem("Game Event End");
    m_comboEventType->addItem("GO State Changed");
    m_comboEventType->addItem("GO Event Inform");
    m_comboEventType->addItem("Action Done");

    m_eventParamWidget = new QWidget(this);
    m_eventParamWidget->setToolTip("Shown are comments in short form. Visit www.trinitycore.info when in doubt or in need of more documentation.");
    m_layout->addRow("Event Parameters: ", m_eventParamWidget);

    m_eventParamLayout = new QHBoxLayout(m_eventParamWidget);
    m_eventParamWidget->setLayout(m_eventParamLayout);

    m_eventParamWidget1 = new QWidget(m_eventParamWidget);
    m_eventParamLayout->addWidget(m_eventParamWidget1);
    m_eventParamLayout1 = new QVBoxLayout(m_eventParamWidget1);
    m_eventParamWidget1->setLayout(m_eventParamLayout1);

    m_editEventParam1 = new QLineEdit(m_eventParamWidget1);
    m_editEventParam1->setValidator(new QIntValidator(this));
    m_eventParamLayout1->addWidget(m_editEventParam1);
    m_editEventParam1->setText("0");

    m_eventParamWidget2 = new QWidget(m_eventParamWidget);
    m_eventParamLayout->addWidget(m_eventParamWidget2);
    m_eventParamLayout2 = new QVBoxLayout(m_eventParamWidget2);
    m_eventParamWidget2->setLayout(m_eventParamLayout2);

    m_editEventParam2 = new QLineEdit(m_eventParamWidget);
    m_editEventParam2->setValidator(new QIntValidator(this));
    m_eventParamLayout2->addWidget(m_editEventParam2);
    m_editEventParam2->setText("0");

    m_eventParamWidget3 = new QWidget(m_eventParamWidget);
    m_eventParamLayout->addWidget(m_eventParamWidget3);
    m_eventParamLayout3 = new QVBoxLayout(m_eventParamWidget3);
    m_eventParamWidget3->setLayout(m_eventParamLayout3);

    m_editEventParam3 = new QLineEdit(m_eventParamWidget);
    m_editEventParam3->setValidator(new QIntValidator(this));
    m_eventParamLayout3->addWidget(m_editEventParam3);
    m_editEventParam3->setText("0");

    m_eventParamWidget4 = new QWidget(m_eventParamWidget);
    m_eventParamLayout->addWidget(m_eventParamWidget4);
    m_eventParamLayout4 = new QVBoxLayout(m_eventParamWidget4);
    m_eventParamWidget4->setLayout(m_eventParamLayout4);

    m_editEventParam4 = new QLineEdit(m_eventParamWidget);
    m_editEventParam4->setValidator(new QIntValidator(this));
    m_eventParamLayout4->addWidget(m_editEventParam4);
    m_editEventParam4->setText("0");

    m_eventParam1Description = new QLabel("", m_eventParamWidget1);
    m_eventParamLayout1->addWidget(m_eventParam1Description);

    m_eventParam2Description = new QLabel("", m_eventParamWidget2);
    m_eventParamLayout2->addWidget(m_eventParam2Description);

    m_eventParam3Description = new QLabel("", m_eventParamWidget3);
    m_eventParamLayout3->addWidget(m_eventParam3Description);

    m_eventParam4Description = new QLabel("", m_eventParamWidget3);
    m_eventParamLayout4->addWidget(m_eventParam4Description);

    connect(m_comboEventType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotEventTypeChanged(int)));
    slotEventTypeChanged(0);//To display help for default event.

    m_comboActionType = new QComboBox(this);
    m_layout->addRow("Action Type: ", m_comboActionType);
    m_comboActionType->addItem("Nothing");//0
    m_comboActionType->addItem("Talk");
    m_comboActionType->addItem("Set Faction");
    m_comboActionType->addItem("Morph to Entry or Model");
    m_comboActionType->addItem("Sound");
    m_comboActionType->addItem("Play Emote");
    m_comboActionType->addItem("Fail Quest");
    m_comboActionType->addItem("Add Quest");
    m_comboActionType->addItem("Set React State");
    m_comboActionType->addItem("Activate GameObject");
    m_comboActionType->addItem("Random Emote");//10
    m_comboActionType->addItem("Cast");
    m_comboActionType->addItem("Summon Creature");
    m_comboActionType->addItem("Threat Single Percent");
    m_comboActionType->addItem("Threat All Percent");
    m_comboActionType->addItem("Call AreaExplored or EventHappens");
    m_comboActionType->addItem("Send CastCreatureOrGo");
    m_comboActionType->addItem("Set Emote State");
    m_comboActionType->addItem("Set Unit Flag");
    m_comboActionType->addItem("Remove Unit Flag");
    m_comboActionType->addItem("Auto Attack");//20
    m_comboActionType->addItem("Allow Combat Movement");
    m_comboActionType->addItem("Set Event Phase");
    m_comboActionType->addItem("Inc Event Phase");
    m_comboActionType->addItem("Evade");
    m_comboActionType->addItem("Flee For Assist");
    m_comboActionType->addItem("Group Event Happens");
    m_comboActionType->addItem("Call CastedCreatureOrGo");
    m_comboActionType->addItem("RemoveAurasFromSpell");
    m_comboActionType->addItem("Follow");
    m_comboActionType->addItem("Random Phase");//30
    m_comboActionType->addItem("Random Phase Range");
    m_comboActionType->addItem("Reset GameObject");
    m_comboActionType->addItem("Call KilledMonster");
    m_comboActionType->addItem("Set Instance Data");
    m_comboActionType->addItem("Set Instance Data64");
    m_comboActionType->addItem("Update Template");
    m_comboActionType->addItem("Die");
    m_comboActionType->addItem("Set In Combat With Zone");
    m_comboActionType->addItem("Call For Help");
    m_comboActionType->addItem("Set Sheath");//40
    m_comboActionType->addItem("Force Despawn");
    m_comboActionType->addItem("Set Invinvibility HP Level");
    m_comboActionType->addItem("Mount To Entry Or Model");
    m_comboActionType->addItem("Set Ingame Phase Mask");
    m_comboActionType->addItem("Set Data");
    m_comboActionType->addItem("Move Forward");
    m_comboActionType->addItem("Set visibility");
    m_comboActionType->addItem("Set Active");
    m_comboActionType->addItem("Attack Start");
    m_comboActionType->addItem("Summon GameObject");//50
    m_comboActionType->addItem("Kill Unit");
    m_comboActionType->addItem("Activate Taxi");
    m_comboActionType->addItem("Waypoint Start");
    m_comboActionType->addItem("Waypoint Pause");
    m_comboActionType->addItem("Waypoint Stop");
    m_comboActionType->addItem("Add Item");
    m_comboActionType->addItem("Remove Item");
    m_comboActionType->addItem("Install AI Template");
    m_comboActionType->addItem("Set Run");
    m_comboActionType->addItem("Set Fly");//60
    m_comboActionType->addItem("Set Swim");
    m_comboActionType->addItem("Teleport");
    m_comboActionType->addItem("Store Variable Decimal");
    m_comboActionType->addItem("Store Target List");
    m_comboActionType->addItem("Waypoint Resume");
    m_comboActionType->addItem("Set Orientation");
    m_comboActionType->addItem("Create Timed Event");
    m_comboActionType->addItem("Play Movie");
    m_comboActionType->addItem("Move to Pos");
    m_comboActionType->addItem("Respawn Target");//70
    m_comboActionType->addItem("Equip");
    m_comboActionType->addItem("Close Gossip");
    m_comboActionType->addItem("Trigger Timed Event");
    m_comboActionType->addItem("Remove Timed Event");
    m_comboActionType->addItem("Add Aura");
    m_comboActionType->addItem("Override Script Base Object");
    m_comboActionType->addItem("Reset Script Base Object");
    m_comboActionType->addItem("Call Script Reset");
    m_comboActionType->addItem("Set Ranged Movement");
    m_comboActionType->addItem("Call Timed Actionlist");//80
    m_comboActionType->addItem("Set NPC Flag");
    m_comboActionType->addItem("Add NPC Flag");
    m_comboActionType->addItem("Remove NPC Flag");
    m_comboActionType->addItem("Simple Talk");
    m_comboActionType->addItem("Invoker Cast");
    m_comboActionType->addItem("Cross Cast");
    m_comboActionType->addItem("Call Random Timed Actionlist");
    m_comboActionType->addItem("Call Random Range Timed Actionlist");
    m_comboActionType->addItem("Random Move");
    m_comboActionType->addItem("Set Unit_Field_Bytes1");//90
    m_comboActionType->addItem("Remove Unit_Field_Bytes1");
    m_comboActionType->addItem("Interrupt Spell");
    m_comboActionType->addItem("Send Go Custom Animation");
    m_comboActionType->addItem("Set Dynamic Flag");
    m_comboActionType->addItem("Add Dynamic Flag");
    m_comboActionType->addItem("Remove Dynamic Flag");
    m_comboActionType->addItem("Jump To Pos");
    m_comboActionType->addItem("Send Gossip Menu");
    m_comboActionType->addItem("GameObject Set Loot State");
    m_comboActionType->addItem("Send Target To Target");//100
    m_comboActionType->addItem("Set Home Pos");
    m_comboActionType->addItem("Set Health Regen");
    m_comboActionType->addItem("Set Root");
    m_comboActionType->addItem("Set GameObject Flag");
    m_comboActionType->addItem("Add GameObject Flag");
    m_comboActionType->addItem("Remove GameObject Flag");
    m_comboActionType->addItem("Summon Creature Group");

    m_comboTarget = new QComboBox(this);
    m_layout->addRow("Target Type: ", m_comboTarget);
    m_comboTarget->addItem("None");
    m_comboTarget->addItem("Self");
    m_comboTarget->addItem("Victim (current target)");
    m_comboTarget->addItem("Second Aggro");
    m_comboTarget->addItem("Last Aggro");
    m_comboTarget->addItem("Random Hostile");
    m_comboTarget->addItem("Random Hostile not Victim");
    m_comboTarget->addItem("Invoker");
    m_comboTarget->addItem("Position");
    m_comboTarget->addItem("Creature Range");
    m_comboTarget->addItem("Creature GUID");
    m_comboTarget->addItem("Creature Distance");
    m_comboTarget->addItem("Stored");
    m_comboTarget->addItem("GameObject Range");
    m_comboTarget->addItem("GameObject GUID");
    m_comboTarget->addItem("GameObject Distance");
    m_comboTarget->addItem("Invoker Party");
    m_comboTarget->addItem("Player Range");
    m_comboTarget->addItem("Player Distance");
    m_comboTarget->addItem("Closest Creature");
    m_comboTarget->addItem("Closest GameObject");
    m_comboTarget->addItem("Closest Player");
    m_comboTarget->addItem("Invoker Vehicle");
    m_comboTarget->addItem("Owner or Summoner");
    m_comboTarget->addItem("Threat List");
    m_comboTarget->addItem("Closest Enemy");

    m_actionWidget = new QWidget(this);
    m_actionWidget->setToolTip("Shown are comments in short form. Visit www.trinitycore.info when in doubt or in need of more documentation.");
    m_layout->addRow("Action Params: ", m_actionWidget);

    m_actionLayout = new QHBoxLayout(m_actionWidget);
    m_actionWidget->setLayout(m_actionLayout);

    m_actionParamWidget1 = new QWidget(m_actionWidget);
    m_actionLayout->addWidget(m_actionParamWidget1);
    m_actionParamLayout1 = new QVBoxLayout(m_actionParamWidget1);
    m_actionParamWidget1->setLayout(m_actionParamLayout1);

    m_actionParamWidget2 = new QWidget(m_actionWidget);
    m_actionLayout->addWidget(m_actionParamWidget2);
    m_actionParamLayout2 = new QVBoxLayout(m_actionParamWidget2);
    m_actionParamWidget2->setLayout(m_actionParamLayout2);

    m_actionParamWidget3 = new QWidget(m_actionWidget);
    m_actionLayout->addWidget(m_actionParamWidget3);
    m_actionParamLayout3 = new QVBoxLayout(m_actionParamWidget3);
    m_actionParamWidget3->setLayout(m_actionParamLayout3);

    m_actionParamWidget4 = new QWidget(m_actionWidget);
    m_actionLayout->addWidget(m_actionParamWidget4);
    m_actionParamLayout4 = new QVBoxLayout(m_actionParamWidget4);
    m_actionParamWidget4->setLayout(m_actionParamLayout4);

    m_actionParamWidget5 = new QWidget(m_actionWidget);
    m_actionLayout->addWidget(m_actionParamWidget5);
    m_actionParamLayout5 = new QVBoxLayout(m_actionParamWidget5);
    m_actionParamWidget5->setLayout(m_actionParamLayout5);

    m_actionParamWidget6 = new QWidget(m_actionWidget);
    m_actionLayout->addWidget(m_actionParamWidget6);
    m_actionParamLayout6 = new QVBoxLayout(m_actionParamWidget6);
    m_actionParamWidget6->setLayout(m_actionParamLayout6);

    m_actionParam1 = new QLineEdit(m_actionParamWidget1);
    m_actionParam1->setValidator(new QDoubleValidator(this));
    m_actionParamLayout1->addWidget(m_actionParam1);
    m_actionParam2 = new QLineEdit(m_actionParamWidget2);
    m_actionParam2->setValidator(new QDoubleValidator(this));
    m_actionParamLayout2->addWidget(m_actionParam2);
    m_actionParam3 = new QLineEdit(m_actionParamWidget3);
    m_actionParam3->setValidator(new QDoubleValidator(this));
    m_actionParamLayout3->addWidget(m_actionParam3);
    m_actionParam4 = new QLineEdit(m_actionParamWidget4);
    m_actionParam4->setValidator(new QDoubleValidator(this));
    m_actionParamLayout4->addWidget(m_actionParam4);
    m_actionParam5 = new QLineEdit(m_actionParamWidget5);
    m_actionParam5->setValidator(new QDoubleValidator(this));
    m_actionParamLayout5->addWidget(m_actionParam5);
    m_actionParam6 = new QLineEdit(m_actionParamWidget6);
    m_actionParam6->setValidator(new QDoubleValidator(this));
    m_actionParamLayout6->addWidget(m_actionParam6);

    m_actionParam1Description = new QLabel("", m_actionParamWidget1);
    m_actionParamLayout1->addWidget(m_actionParam1Description);
    m_actionParam2Description = new QLabel("", m_actionParamWidget2);
    m_actionParamLayout2->addWidget(m_actionParam2Description);
    m_actionParam3Description = new QLabel("", m_actionParamWidget3);
    m_actionParamLayout3->addWidget(m_actionParam3Description);
    m_actionParam4Description = new QLabel("", m_actionParamWidget4);
    m_actionParamLayout4->addWidget(m_actionParam4Description);
    m_actionParam5Description = new QLabel("", m_actionParamWidget5);
    m_actionParamLayout5->addWidget(m_actionParam5Description);
    m_actionParam6Description = new QLabel("", m_actionParamWidget6);
    m_actionParamLayout6->addWidget(m_actionParam6Description);

    connect(m_comboActionType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotActionTypeChanged(int)));
    slotActionTypeChanged(0);


    m_comments = new QLineEdit(this);
    m_comments->setToolTip("Comments are mandatory on my watch. Good comments are like: \"Mob XYZ - Cast spell whatever every x-y seconds.\" or \"Mob XYZ - Complete Quest upon death.\"");
    m_layout->addRow("Comments: ", m_comments);

    m_targetWidget2 = new QWidget(this);
    m_targetWidget2->setToolTip("Shown are comments in short form. Visit www.trinitycore.info when in doubt or in need of more documentation.");
    m_layout->addRow("Target: ", m_targetWidget2);

    m_targetLayout2 = new QHBoxLayout(m_targetWidget2);
    m_targetWidget2->setLayout(m_targetLayout2);

    m_targetDescriptionWidget1 = new QWidget(m_targetWidget2);
    m_targetLayout2->addWidget(m_targetDescriptionWidget1);
    m_targetDescriptionLayout1 = new QVBoxLayout(m_targetDescriptionWidget1);
    m_targetDescriptionWidget1->setLayout(m_targetDescriptionLayout1);

    m_targetDescriptionWidget2 = new QWidget(m_targetWidget2);
    m_targetLayout2->addWidget(m_targetDescriptionWidget2);
    m_targetDescriptionLayout2 = new QVBoxLayout(m_targetDescriptionWidget2);
    m_targetDescriptionWidget2->setLayout(m_targetDescriptionLayout2);

    m_targetDescriptionWidget3 = new QWidget(m_targetWidget2);
    m_targetLayout2->addWidget(m_targetDescriptionWidget3);
    m_targetDescriptionLayout3 = new QVBoxLayout(m_targetDescriptionWidget3);
    m_targetDescriptionWidget3->setLayout(m_targetDescriptionLayout3);

    m_editTarget1 = new QLineEdit(m_targetDescriptionWidget1);
    m_editTarget1->setValidator(new QIntValidator(this));
    m_targetDescriptionLayout1->addWidget(m_editTarget1);

    m_editTarget2 = new QLineEdit(m_targetDescriptionWidget2);
    m_editTarget2->setValidator(new QIntValidator(this));
    m_targetDescriptionLayout2->addWidget(m_editTarget2);

    m_editTarget3 = new QLineEdit(m_targetDescriptionWidget3);
    m_editTarget3->setValidator(new QIntValidator(this));
    m_targetDescriptionLayout3->addWidget(m_editTarget3);

    m_targetDescription1 = new QLabel("", m_targetDescriptionWidget1);
    m_targetDescriptionLayout1->addWidget(m_targetDescription1);
    m_targetDescription2 = new QLabel("", m_targetDescriptionWidget2);
    m_targetDescriptionLayout2->addWidget(m_targetDescription2);
    m_targetDescription3 = new QLabel("", m_targetDescriptionWidget3);
    m_targetDescriptionLayout3->addWidget(m_targetDescription3);

    m_targetWidget = new QWidget(this);
    m_layout->addRow("Target: ", m_targetWidget);

    m_targetLayout = new QHBoxLayout(m_targetWidget);
    m_targetWidget->setLayout(m_targetLayout);

    m_labelX = new QLabel("X: ", m_targetWidget);
    m_targetLayout->addWidget(m_labelX);

    m_editTargetX = new QLineEdit(m_targetWidget);
    m_editTargetX->setValidator(new QDoubleValidator(this));
    m_targetLayout->addWidget(m_editTargetX);

    m_labelY = new QLabel("Y: ", m_targetWidget);
    m_targetLayout->addWidget(m_labelY);

    m_editTargetY = new QLineEdit(m_targetWidget);
    m_editTargetY->setValidator(new QDoubleValidator(this));
    m_targetLayout->addWidget(m_editTargetY);

    m_labelZ = new QLabel("Z: ", m_targetWidget);
    m_targetLayout->addWidget(m_labelZ);

    m_editTargetZ = new QLineEdit(m_targetWidget);
    m_editTargetZ->setValidator(new QDoubleValidator(this));
    m_targetLayout->addWidget(m_editTargetZ);

    m_labelO = new QLabel("O: ", m_targetWidget);
    m_targetLayout->addWidget(m_labelO);

    m_editTargetO = new QLineEdit(m_targetWidget);
    m_editTargetO->setValidator(new QDoubleValidator(this));
    m_targetLayout->addWidget(m_editTargetO);

    connect(m_comboTarget, SIGNAL(currentIndexChanged(int)), this, SLOT(slotTargetChanged(int)));
    slotTargetChanged(0);

    m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Help, Qt::Horizontal, this);
    m_layout->addRow(m_buttons);
    connect(m_buttons, SIGNAL(accepted()), this, SLOT(slotAccepted()));
    connect(m_buttons, SIGNAL(rejected()), this, SLOT(slotRejected()));
    connect(m_buttons, SIGNAL(helpRequested()), this, SLOT(slotHelpRequested()));

}

ScriptGenerator::ScriptGenerator(ScriptEntryRaw *script, QWidget *parent):QDialog(parent){
    init();
	m_script = 0;
	m_scriptUsed = false;
	for(int i = 0; i < script->count(); i++){
		QString key, value;
		script->get(i, key, value);
		if(key == "link"){
			m_editLink->setText(value);
		}else if(key == "event_phase_mask"){
			m_editPhaseMask->setText(value);
		}else if(key == "ChanceOrQuestChance"){
			m_editChance->setText(value);
		}else if(key == "event_flags"){
			unsigned flag = value.toUInt();
			if(flag & 0x1)
				m_checkRepeat->setChecked(true);
			if(flag & 0x2)
				m_check0->setChecked(true);
			if(flag & 0x4)
				m_check1->setChecked(true);
			if(flag & 0x8)
				m_check2->setChecked(true);
			if(flag & 0x10)
				m_check3->setChecked(true);
			if(flag & 0x20)
				m_checkDebug->setChecked(true);
		}else if(key == "event_type"){
			m_comboEventType->setCurrentIndex(value.toInt());
		}else if(key == "event_param1"){
			m_editEventParam1->setText(value);
		}else if(key == "event_param2"){
			m_editEventParam2->setText(value);
		}else if(key == "event_param3"){
			m_editEventParam3->setText(value);
		}else if(key == "event_param4"){
			m_editEventParam4->setText(value);
		}else if(key == "action_type"){
			m_comboActionType->setCurrentIndex(value.toInt());
		}else if(key == "action_param1"){
			m_actionParam1->setText(value);
		}else if(key == "action_param2"){
			m_actionParam2->setText(value);
		}else if(key == "action_param3"){
			m_actionParam3->setText(value);
		}else if(key == "action_param4"){
			m_actionParam4->setText(value);
		}else if(key == "action_param5"){
			m_actionParam5->setText(value);
		}else if(key == "action_param6"){
			m_actionParam6->setText(value);
		}else if(key == "target_type"){
			m_comboTarget->setCurrentIndex(value.toInt());
		}else if(key == "target_param1"){
			m_editTarget1->setText(value);
		}else if(key == "target_param2"){
			m_editTarget2->setText(value);
		}else if(key == "target_param3"){
			m_editTarget3->setText(value);
		}else if(key == "target_x"){
			m_editTargetX->setText(value);
		}else if(key == "target_y"){
			m_editTargetY->setText(value);
		}else if(key == "target_z"){
			m_editTargetZ->setText(value);
		}else if(key == "target_o"){
			m_editTargetO->setText(value);
		}else if(key == "comment"){
			m_comments->setText(value.replace("\"", ""));
		}
	}
}

ScriptGenerator::~ScriptGenerator(){
	if(m_script && !m_scriptUsed){
		delete m_script;
	}
	m_script = 0;
}

void ScriptGenerator::slotAccepted(){
	if(m_comments->hasAcceptableInput() && !m_comments->text().isEmpty()){
		m_script = new ScriptEntryRaw;
		if(!m_editLink->text().isEmpty())
			m_script->add("link", m_editLink->text());
		if(!m_editPhaseMask->text().isEmpty())
			m_script->add("event_phase_mask", m_editPhaseMask->text());
		if(!m_editChance->text().isEmpty())
			m_script->add("ChanceOrQuestChance", m_editChance->text());
		unsigned flags = 0;
		if(m_checkRepeat->isChecked())
			flags += 0x1;
		if(m_check0->isChecked())
			flags += 0x2;
		if(m_check1->isChecked())
			flags += 0x4;
		if(m_check2->isChecked())
			flags += 0x8;
		if(m_check3->isChecked())
			flags += 0x10;
		if(m_checkDebug->isChecked())
			flags += 0x20;
		m_script->add("event_flags", QString().setNum(flags));
		m_script->add("event_type", QString().setNum(m_comboEventType->currentIndex()));
		if(!m_editEventParam1->text().isEmpty())
			m_script->add("event_param1", m_editEventParam1->text());
		if(!m_editEventParam2->text().isEmpty())
			m_script->add("event_param2", m_editEventParam2->text());
		if(!m_editEventParam3->text().isEmpty())
			m_script->add("event_param3", m_editEventParam3->text());
		if(!m_editEventParam4->text().isEmpty())
			m_script->add("event_param4", m_editEventParam4->text());
		m_script->add("action_type", QString().setNum(m_comboActionType->currentIndex()));
		if(!m_actionParam1->text().isEmpty())
			m_script->add("action_param1", m_actionParam1->text());
		if(!m_actionParam2->text().isEmpty())
			m_script->add("action_param2", m_actionParam2->text());
		if(!m_actionParam3->text().isEmpty())
			m_script->add("action_param3", m_actionParam3->text());
		if(!m_actionParam4->text().isEmpty())
			m_script->add("action_param4", m_actionParam4->text());
		if(!m_actionParam5->text().isEmpty())
			m_script->add("action_param5", m_actionParam5->text());
		if(!m_actionParam6->text().isEmpty())
			m_script->add("action_param6", m_actionParam6->text());
		m_script->add("target_type", QString().setNum(m_comboTarget->currentIndex()));
		if(!m_editTarget1->text().isEmpty())
			m_script->add("target_param1", m_editTarget1->text());
		if(!m_editTarget2->text().isEmpty())
			m_script->add("target_param2", m_editTarget2->text());
		if(!m_editTarget3->text().isEmpty())
			m_script->add("target_param3", m_editTarget3->text());
		if(!m_editTargetX->text().isEmpty())
			m_script->add("target_x", m_editTargetX->text());
		if(!m_editTargetY->text().isEmpty())
			m_script->add("target_y", m_editTargetY->text());
		if(!m_editTargetZ->text().isEmpty())
			m_script->add("target_z", m_editTargetZ->text());
		if(!m_editTargetO->text().isEmpty())
			m_script->add("target_o", m_editTargetO->text());
		m_script->add("comment", QString("\"") + m_comments->text() + QString("\""));
		accept();
	}else
		QMessageBox::warning(this, "Nope!", "Sorry, but I'm not going to let you write scripts without comments. You know, other people might want to read that shit!");
}

void ScriptGenerator::slotRejected(){
	reject();
}

void ScriptGenerator::slotHelpRequested(){
    QDesktopServices::openUrl(QUrl("http://collab.kpsn.org/display/tc/smart_scripts"));
}

ScriptEntryRaw *ScriptGenerator::getSQL(QString &sql, QString &comment){
	comment = m_comments->text();
	sql = "INSERT INTO smart_scripts (";
	if(m_editLink->hasAcceptableInput() && !m_editLink->text().isEmpty())
		sql += "link, ";
	if(m_editPhaseMask->hasAcceptableInput()&& !m_editPhaseMask->text().isEmpty())
		sql += "event_phase_mask, ";
	if(m_editChance->hasAcceptableInput() && !m_editChance->text().isEmpty())
		sql += "event_chance, ";
	if(m_checkRepeat->isChecked() || m_check0->isChecked() || m_check1->isChecked() || m_check2->isChecked() || m_check3->isChecked() || m_checkDebug->isChecked())
		sql += "event_flags, ";
	sql += "event_type, ";
	if(m_editEventParam1->hasAcceptableInput() && !m_editEventParam1->text().isEmpty())
		sql += "event_param1, ";
	if(m_editEventParam2->hasAcceptableInput() && !m_editEventParam2->text().isEmpty())
		sql += "event_param2, ";
	if(m_editEventParam3->hasAcceptableInput() && !m_editEventParam3->text().isEmpty())
		sql += "event_param3, ";
	if(m_editEventParam4->hasAcceptableInput() && !m_editEventParam4->text().isEmpty())
		sql += "event_param4, ";
	sql += "action_type, ";
	if(m_actionParam1->hasAcceptableInput() && !m_actionParam1->text().isEmpty())
		sql += "action_param1, ";
	if(m_actionParam2->hasAcceptableInput() && !m_actionParam2->text().isEmpty())
		sql += "action_param2, ";
	if(m_actionParam3->hasAcceptableInput() && !m_actionParam3->text().isEmpty())
		sql += "action_param3, ";
	if(m_actionParam4->hasAcceptableInput() && !m_actionParam4->text().isEmpty())
		sql += "action_param4, ";
	if(m_actionParam5->hasAcceptableInput() && !m_actionParam5->text().isEmpty())
		sql += "action_param5, ";
	if(m_actionParam6->hasAcceptableInput() && !m_actionParam6->text().isEmpty())
		sql += "action_param6, ";
	sql += "target_type, ";
	if(m_editTarget1->hasAcceptableInput() && !m_editTarget1->text().isEmpty())
		sql += "target_param1, ";
	if(m_editTarget2->hasAcceptableInput() && !m_editTarget2->text().isEmpty())
		sql += "target_param2, ";
	if(m_editTarget3->hasAcceptableInput() && !m_editTarget3->text().isEmpty())
		sql += "target_param3, ";
	if(m_editTargetX->hasAcceptableInput() && !m_editTargetX->text().isEmpty())
		sql += "target_x, ";
	if(m_editTargetY->hasAcceptableInput() && !m_editTargetY->text().isEmpty())
		sql += "target_y, ";
	if(m_editTargetZ->hasAcceptableInput() && !m_editTargetZ->text().isEmpty())
		sql += "target_z, ";
	if(m_editTargetO->hasAcceptableInput() && !m_editTargetO->text().isEmpty())
		sql += "target_o, ";
	sql += "comment, entryorguid, source_type, id) VALUES (";
	
	//=====================================================================================================================================================
	
	if(m_editLink->hasAcceptableInput() && m_editLink->text().isEmpty())
		sql += m_editLink->text() + ", ";
	if(m_editPhaseMask->hasAcceptableInput() && m_editPhaseMask->text().isEmpty())
		sql += m_editPhaseMask->text() + ", ";
	if(m_editChance->hasAcceptableInput() && m_editChance->text().isEmpty())
		sql += m_editChance->text() + ", ";
	if(m_checkRepeat->isChecked() || m_check0->isChecked() || m_check1->isChecked() || m_check2->isChecked() || m_check3->isChecked() || m_checkDebug->isChecked()){
		int num = 0;
		if(m_checkRepeat->isChecked())
			num += 1;
		if(m_check0->isChecked())
			num += 2;
		if(m_check1->isChecked())
			num += 4;
		if(m_check2->isChecked())
			num += 8;
		if(m_check3->isChecked())
			num += 16;
		if(m_checkDebug->isChecked())
			num += 32;
		sql += QString().setNum(num) + ", ";
	}
	sql += QString().setNum(m_comboEventType->currentIndex()) + ", ";
	if(m_editEventParam1->hasAcceptableInput() && !m_editEventParam1->text().isEmpty())
		sql += m_editEventParam1->text() + ", ";
	if(m_editEventParam2->hasAcceptableInput() && !m_editEventParam2->text().isEmpty())
		sql += m_editEventParam2->text() + ", ";
	if(m_editEventParam3->hasAcceptableInput() && !m_editEventParam3->text().isEmpty())
		sql += m_editEventParam3->text() + ", ";
	if(m_editEventParam4->hasAcceptableInput() && !m_editEventParam4->text().isEmpty())
		sql += m_editEventParam4->text() + ", ";
	sql += QString().setNum(m_comboActionType->currentIndex()) + ", ";
	if(m_actionParam1->hasAcceptableInput() && !m_actionParam1->text().isEmpty())
		sql += m_actionParam1->text() + ", ";
	if(m_actionParam2->hasAcceptableInput() && !m_actionParam2->text().isEmpty())
		sql += m_actionParam2->text() + ", ";
	if(m_actionParam3->hasAcceptableInput() && !m_actionParam3->text().isEmpty())
		sql += m_actionParam3->text() + ", ";
	if(m_actionParam4->hasAcceptableInput() && !m_actionParam4->text().isEmpty())
		sql += m_actionParam4->text() + ", ";
	if(m_actionParam5->hasAcceptableInput() && !m_actionParam5->text().isEmpty())
		sql += m_actionParam5->text() + ", ";
	if(m_actionParam6->hasAcceptableInput() && !m_actionParam6->text().isEmpty())
		sql += m_actionParam6->text() + ", ";
	sql += QString().setNum(m_comboTarget->currentIndex()) + ", ";
	if(m_editTarget1->hasAcceptableInput() && !m_editTarget1->text().isEmpty())
		sql += m_editTarget1->text() + ", ";
	if(m_editTarget2->hasAcceptableInput() && !m_editTarget2->text().isEmpty())
		sql += m_editTarget2->text() + ", ";
	if(m_editTarget3->hasAcceptableInput() && !m_editTarget3->text().isEmpty())
		sql += m_editTarget3->text() + ", ";
	if(m_editTargetX->hasAcceptableInput() && !m_editTargetX->text().isEmpty())
		sql += m_editTargetX->text() + ", ";
	if(m_editTargetY->hasAcceptableInput() && !m_editTargetY->text().isEmpty())
		sql += m_editTargetY->text() + ", ";
	if(m_editTargetZ->hasAcceptableInput() && !m_editTargetZ->text().isEmpty())
		sql += m_editTargetZ->text() + ", ";
	if(m_editTargetO->hasAcceptableInput() && !m_editTargetO->text().isEmpty())
		sql += m_editTargetO->text() + ", ";
	sql += "\"" + m_comments->text() + "\", ";
	
	m_scriptUsed = true;
	return m_script;
}

void ScriptGenerator::slotEventTypeChanged(int current){
	m_editEventParam1->setEnabled(true);
	m_editEventParam2->setEnabled(true);
	m_editEventParam3->setEnabled(true);
	m_editEventParam4->setEnabled(true);
	switch(current){
		case SMART_EVENT_UPDATE_IC:
			m_eventParam1Description->setText("init min");
			m_eventParam2Description->setText("init max");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_UPDATE_OOC:
			m_eventParam1Description->setText("init min");
			m_eventParam2Description->setText("init max");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_HEALT_PCT:
			m_eventParam1Description->setText("min hp %");
			m_eventParam2Description->setText("max hp %");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_MANA_PCT:
			m_eventParam1Description->setText("min mana %");
			m_eventParam2Description->setText("max mana %");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_AGGRO:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_KILL:
			m_eventParam1Description->setText("min cooldown");
			m_eventParam2Description->setText("max cooldown");
			m_eventParam3Description->setText("player only?");
			m_eventParam4Description->setText("creature ID");
			break;
		case SMART_EVENT_DEATH:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_EVADE:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_SPELLHIT:
			m_eventParam1Description->setText("spell ID");
			m_eventParam2Description->setText("spell school");
			m_eventParam3Description->setText("cooldown min");
			m_eventParam4Description->setText("cooldown max");
			break;
		case SMART_EVENT_RANGE:
			m_eventParam1Description->setText("min dist");
			m_eventParam2Description->setText("max dist");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_OOC_LOS:
			m_eventParam1Description->setText("No hostile?");
			m_eventParam2Description->setText("max range");
			m_eventParam3Description->setText("cooldown min");
			m_eventParam4Description->setText("cooldown max");
			break;
		case SMART_EVENT_RESPAWN:
			m_eventParam1Description->setText("type");
			m_eventParam2Description->setText("map ID");
			m_eventParam3Description->setText("zone ID");
			m_eventParam4Description->setText("");
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_TARGET_HEALTH_PCT:
			m_eventParam1Description->setText("min hp %");
			m_eventParam2Description->setText("max hp %");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_TARGET_CASTING:
			m_eventParam1Description->setText("repeat min");
			m_eventParam2Description->setText("repeat max");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_FRIENDLY_HEALTH:
			m_eventParam1Description->setText("hp deficit");
			m_eventParam2Description->setText("radius");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_FRIENDLY_IS_CC:
			m_eventParam1Description->setText("radius");
			m_eventParam2Description->setText("repeat min");
			m_eventParam3Description->setText("repeat max");
			m_eventParam4Description->setText("");
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_FRIENDLY_MISSING_BUFF:
			m_eventParam1Description->setText("spell ID");
			m_eventParam2Description->setText("radius");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_SUMMONED_UNIT:
			m_eventParam1Description->setText("creature ID");
			m_eventParam2Description->setText("cooldown min");
			m_eventParam3Description->setText("cooldown max");
			m_eventParam4Description->setText("");
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_TARGET_MANA_PCT:
			m_eventParam1Description->setText("min mana %");
			m_eventParam2Description->setText("max mana %");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_ACCEPTED_QUEST:
			m_eventParam1Description->setText("quest ID");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_REWARD_QUEST:
			m_eventParam1Description->setText("quest ID");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_REACHED_HOME:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_RECEIVE_EMOTE:
			m_eventParam1Description->setText("emote ID");
			m_eventParam2Description->setText("cooldown min");
			m_eventParam3Description->setText("cooldown max");
			m_eventParam4Description->setText("condition (?)");
			break;
		case SMART_EVENT_HAS_AURA:
			m_eventParam1Description->setText("spell ID");
			m_eventParam2Description->setText("stacks");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_TARGET_BUFFED:
			m_eventParam1Description->setText("spell ID");
			m_eventParam2Description->setText("stacks");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_RESET:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_IC_LOS:
			m_eventParam1Description->setText("No hostile?");
			m_eventParam2Description->setText("max range");
			m_eventParam3Description->setText("cooldown min");
			m_eventParam4Description->setText("cooldown max");
			break;
		case SMART_EVENT_PASSENGER_BOARDED:
			m_eventParam1Description->setText("cooldown min");
			m_eventParam2Description->setText("cooldown max");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_PASSENGER_REMOVED:
			m_eventParam1Description->setText("cooldown min");
			m_eventParam2Description->setText("cooldown max");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_CHARMED:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_CHARMED_TARGET:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_SPELLHIT_TARGET:
			m_eventParam1Description->setText("spell ID");
			m_eventParam2Description->setText("school");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_DAMAGED:
			m_eventParam1Description->setText("min dmg");
			m_eventParam2Description->setText("max dmg");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_DAMAGED_TARGET:
			m_eventParam1Description->setText("min dmg");
			m_eventParam2Description->setText("max dmg");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_MOVEMENTINFORM:
			m_eventParam1Description->setText("MovementType");
			m_eventParam2Description->setText("point ID");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_SUMMON_DESPAWNED:
			m_eventParam1Description->setText("entry");
			m_eventParam2Description->setText("cooldown min");
			m_eventParam3Description->setText("cooldown max");
			m_eventParam4Description->setText("");
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_CORPSE_REMOVED:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_AI_INIT:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_DATA_SET:
			m_eventParam1Description->setText("field");
			m_eventParam2Description->setText("value");
			m_eventParam3Description->setText("cooldown min");
			m_eventParam4Description->setText("cooldown max");
			break;
		case SMART_EVENT_WAYPOINT_START:
			m_eventParam1Description->setText("point id");
			m_eventParam2Description->setText("path id");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_WAYPOINT_REACHED:
			m_eventParam1Description->setText("point id");
			m_eventParam2Description->setText("path id");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_TRANSPORT_ADDPLAYER:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_TRANSPORT_ADDCREATURE:
			m_eventParam1Description->setText("entry");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_TRANSPORT_REMOVE_PLAYER:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_TRANSPORT_RELOCATE:
			m_eventParam1Description->setText("point id");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_INSTANCE_PLAYER_ENTER:
			m_eventParam1Description->setText("Team (0 if any)");
			m_eventParam2Description->setText("cooldown min");
			m_eventParam3Description->setText("cooldown max");
			m_eventParam4Description->setText("");
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_AREATRIGGER_ONTRIGGER:
			m_eventParam1Description->setText("Trigger id (0 if any)");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_QUEST_ACCEPTED:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_QUEST_OBJ_COPLETETION:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_QUEST_COMPLETION:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_QUEST_REWARDED:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_QUEST_FAIL:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_TEXT_OVER:
			m_eventParam1Description->setText("Group id (from creature_text)");
			m_eventParam2Description->setText("creature ID (0 if any)");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_RECEIVE_HEAL:
			m_eventParam1Description->setText("min heal");
			m_eventParam2Description->setText("max heal");
			m_eventParam3Description->setText("cooldown min");
			m_eventParam4Description->setText("cooldown max");
			break;
		case SMART_EVENT_JUST_SUMMONED:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_WAYPOINT_PAUSED:
			m_eventParam1Description->setText("point ID (0 if any)");
			m_eventParam2Description->setText("path ID (0 if any)");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_WAYPOINT_RESUMED:
			m_eventParam1Description->setText("point ID (0 if any)");
			m_eventParam2Description->setText("path ID (0 if any)");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_WAYPOINT_STOPPED:
			m_eventParam1Description->setText("point ID (0 if any)");
			m_eventParam2Description->setText("path ID (0 if any)");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_WAYPOINT_ENDED:
			m_eventParam1Description->setText("point ID (0 if any)");
			m_eventParam2Description->setText("path ID (0 if any)");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_TIMED_EVENT_TRIGGERED:
			m_eventParam1Description->setText("Id");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_UPDATE:
			m_eventParam1Description->setText("init min");
			m_eventParam2Description->setText("init max");
			m_eventParam3Description->setText("repeat min");
			m_eventParam4Description->setText("repeat max");
			break;
		case SMART_EVENT_LINK:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_GOSSIP_SELECT:
			m_eventParam1Description->setText("menu ID");
			m_eventParam2Description->setText("ID");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_JUST_CREATED:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_GOSSIP_HELLO:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_FOLLOW_COMPLETED:
			m_eventParam1Description->setText("");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam1->setText("");
			m_editEventParam1->setDisabled(true);
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_DUMMY_EFFECT:
			m_eventParam1Description->setText("spell ID");
			m_eventParam2Description->setText("effect index");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_IS_BEHIND_TARGET:
			m_eventParam1Description->setText("cooldown min");
			m_eventParam2Description->setText("cooldown max");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_GAME_EVENT_START:
			m_eventParam1Description->setText("game_event.eventEntry");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_GAME_EVENT_END:
			m_eventParam1Description->setText("game_event.eventEntry");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_GO_STATE_CHANGED:
			m_eventParam1Description->setText("State");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_GO_EVENT_INFORM:
			m_eventParam1Description->setText("event ID");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_ACTION_DONE:
			m_eventParam1Description->setText("event ID");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_ON_SPELLCLICK:
			m_eventParam1Description->setText("clicker");
			m_eventParam2Description->setText("");
			m_eventParam3Description->setText("");
			m_eventParam4Description->setText("");
			m_editEventParam2->setText("");
			m_editEventParam2->setDisabled(true);
			m_editEventParam3->setText("");
			m_editEventParam3->setDisabled(true);
			m_editEventParam4->setText("");
			m_editEventParam4->setDisabled(true);
			break;
		case SMART_EVENT_FRIENDLY_HEALTH_PCT:
			m_eventParam1Description->setText("min hp %");
			m_eventParam2Description->setText("max hp %");
			m_eventParam3Description->setText("cooldown min");
			m_eventParam4Description->setText("cooldown max");
			break;
        default:
            QMessageBox::critical(0, "Bad shit happened!", "Something terrible happened selecting an event. Please contact Sanity!");
	}
}

void ScriptGenerator::slotActionTypeChanged(int current){
	m_actionParam1->setEnabled(true);
	m_actionParam2->setEnabled(true);
	m_actionParam3->setEnabled(true);
	m_actionParam4->setEnabled(true);
	m_actionParam5->setEnabled(true);
	m_actionParam6->setEnabled(true);
	switch(current){
		case SMART_ACTION_NONE:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam1->setDisabled(true);
			m_actionParam1->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_TALK:
			m_actionParam1Description->setText("creature_text.groupid");
			m_actionParam2Description->setText("time before TEXT_OVER");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_FACTION:
			m_actionParam1Description->setText("factionID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL:
			m_actionParam1Description->setText("creature_template.entry");
			m_actionParam2Description->setText("creature_template.modelID");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SOUND:
			m_actionParam1Description->setText("soundID");
			m_actionParam2Description->setText("only self?");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_PLAY_EMOTE:
			m_actionParam1Description->setText("emoteID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_FAIL_QUEST:
			m_actionParam1Description->setText("quest ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_QUEST:
			m_actionParam1Description->setText("quest ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_REACT_STATE:
			m_actionParam1Description->setText("State");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_ACTIVATE_GOBJECT:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam1->setDisabled(true);
			m_actionParam1->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_RANDOM_EMOTE:
			m_actionParam1Description->setText("emote id1");
			m_actionParam2Description->setText("emote id2");
			m_actionParam3Description->setText("emote id3");
			m_actionParam4Description->setText("emote id4");
			m_actionParam5Description->setText("emote id5");
			m_actionParam6Description->setText("emote id6");
			break;
		case SMART_ACTION_CAST:
			m_actionParam1Description->setText("spellID");
			m_actionParam2Description->setText("cast flags");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SUMMON_CREATURE:
			m_actionParam1Description->setText("creature_template.entry");
			m_actionParam2Description->setText("summonType");
			m_actionParam3Description->setText("duration");
			m_actionParam4Description->setText("storageID (always 0)");
			m_actionParam5Description->setText("attack invoker?");
			m_actionParam6Description->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_THREAT_SINGLE_PCT:
            m_actionParam1Description->setText("threat % inc");
            m_actionParam2Description->setText("threat % dec");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_THREAT_ALL_PCT:
            m_actionParam1Description->setText("threat % inc");
            m_actionParam2Description->setText("thread % dec");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS:
            m_actionParam1Description->setText("quest ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_UNUSED_16:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			break;
		case SMART_ACTION_SET_EMOTE_STATE:
            m_actionParam1Description->setText("emote ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_UNIT_FLAG:
            m_actionParam1Description->setText("flags");
            m_actionParam2Description->setText("0 unit_flags, 1 unit_flags2");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_UNIT_FLAG:
            m_actionParam1Description->setText("flags");
            m_actionParam2Description->setText("0 unit_flags, 1 unit_flags2");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_AUTO_ATTACK:
            m_actionParam1Description->setText("0 stop, else continue");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_ALLOW_COMBAT_MOVEMENT:
            m_actionParam1Description->setText("0 stop, else continue");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_EVENT_PHASE:
            m_actionParam1Description->setText("smart_scripts.event_phase_mask");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_INC_EVENT_PHASE:
            m_actionParam1Description->setText("increment");
            m_actionParam2Description->setText("decrement");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_EVADE:
            m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
            m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_FLEE_FOR_ASSIST:
            m_actionParam1Description->setText("0 no text, 1 text");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_GROUPEVENTHAPPENS:
            m_actionParam1Description->setText("quest ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_CASTEDCREATUREORGO:
            m_actionParam1Description->setText("creature_template.entry");
            m_actionParam2Description->setText("spell ID");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVEAURASFROMSPELL:
            m_actionParam1Description->setText("spell ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_FOLLOW:
            m_actionParam1Description->setText("distance (0 default)");
            m_actionParam2Description->setText("angle (0 default)");
            m_actionParam3Description->setText("End creature_template.entry (?)");
            m_actionParam4Description->setText("credit");
            m_actionParam5Description->setText("credit type (0 kill, 1 event)");
			m_actionParam6Description->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_RANDOM_PHASE:
            m_actionParam1Description->setText("smart_scripts.event_phase_mask1");
            m_actionParam2Description->setText("smart_scripts.event_phase_mask2");
            m_actionParam3Description->setText("smart_scripts.event_phase_mask3");
            m_actionParam4Description->setText("smart_scripts.event_phase_mask4");
            m_actionParam5Description->setText("smart_scripts.event_phase_mask5");
            m_actionParam6Description->setText("smart_scripts.event_phase_mask6");
			break;
		case SMART_ACTION_RANDOM_PHASE_RANGE:
            m_actionParam1Description->setText("smart_scripts.event_phase_mask minimum");
            m_actionParam2Description->setText("smart_scripts.event_phase_mask maximum");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_RESET_GOBJECT:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_KILLEDMONSTER:
            m_actionParam1Description->setText("creature_template.entry");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_INST_DATA:
            m_actionParam1Description->setText("field");
            m_actionParam2Description->setText("data");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_INST_DATA64:
            m_actionParam1Description->setText("field");
            m_actionParam2Description->setText("data64");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_UPDATE_TEMPLATE:
            m_actionParam1Description->setText("creature_template.entry");
            m_actionParam2Description->setText("Team");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_DIE:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_IN_COMBAT_WITH_ZONE:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_FOR_HELP:
            m_actionParam1Description->setText("radius");
            m_actionParam2Description->setText("0 no text, 1 text");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_SHEATH:
            m_actionParam1Description->setText("0 unarmed, 1 melee, 2 ranged");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_FORCE_DESPAWN:
            m_actionParam1Description->setText("timer");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL:
            m_actionParam1Description->setText("flat hp value");
            m_actionParam2Description->setText("percent hp value");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL:
            m_actionParam1Description->setText("creature_template.entry");
            m_actionParam2Description->setText("creature_template.modelid");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_INGAME_PHASE_MASK:
            m_actionParam1Description->setText("creature.phaseMask");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_DATA:
            m_actionParam1Description->setText("field");
            m_actionParam2Description->setText("data");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_MOVE_FORWARD:
            m_actionParam1Description->setText("distance");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_VISIBILITY:
            m_actionParam1Description->setText("0 invis, 1 vis");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_ACTIVE:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_ATTACK_START:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SUMMON_GO:
            m_actionParam1Description->setText("gameobject_template.entry");
            m_actionParam2Description->setText("despawntime");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_KILL_UNIT:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_ACTIVATE_TAXI:
            m_actionParam1Description->setText("taxi ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_WP_START:
            m_actionParam1Description->setText("0 walk, 1 run");
            m_actionParam2Description->setText("Waypoints.entry");
            m_actionParam3Description->setText("canRepeat");
            m_actionParam4Description->setText("quest_template.id");
            m_actionParam5Description->setText("despawntime");
            m_actionParam6Description->setText("reactstate");
			break;
		case SMART_ACTION_WP_PAUSE:
            m_actionParam1Description->setText("time");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_WP_STOP:
            m_actionParam1Description->setText("despawntime");
            m_actionParam2Description->setText("quest_template.id");
            m_actionParam3Description->setText("fail (0/1)");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_ITEM:
            m_actionParam1Description->setText("item_template.entry");
            m_actionParam2Description->setText("amount");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_ITEM:
            m_actionParam1Description->setText("item_template.entry");
            m_actionParam2Description->setText("amount");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_INSTALL_AI_TEMPLATE:
            m_actionParam1Description->setText("template ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_RUN:
            m_actionParam1Description->setText("0/1");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_FLY:
            m_actionParam1Description->setText("0/1");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_SWIM:
            m_actionParam1Description->setText("0/1");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_TELEPORT:
            m_actionParam1Description->setText("map ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_STORE_VARIABLE_DECIMAL:
            m_actionParam1Description->setText("var ID");
            m_actionParam2Description->setText("number");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_STORE_TARGET_LIST:
            m_actionParam1Description->setText("var ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_WP_RESUME:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_ORIENTATION:
            m_actionParam1Description->setText("orientation");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_CREATE_TIMED_EVENT:
            m_actionParam1Description->setText("id");
            m_actionParam2Description->setText("init min");
            m_actionParam3Description->setText("init max");
            m_actionParam4Description->setText("repeat min");
            m_actionParam5Description->setText("repeat max");
            m_actionParam6Description->setText("chance");
			break;
		case SMART_ACTION_PLAYMOVIE:
            m_actionParam1Description->setText("entry");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_MOVE_TO_POS:
            m_actionParam1Description->setText("PointID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_RESPAWN_TARGET:
            m_actionParam1Description->setText("respawntime (second) for GO");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_EQUIP:
            m_actionParam1Description->setText("creature_equip_template.entry");
            m_actionParam2Description->setText("slotmask");
            m_actionParam3Description->setText("slot1 (item_template.entry)");
            m_actionParam4Description->setText("slot2 (item_template.entry)");
            m_actionParam5Description->setText("slot3 (item_template.entry)");
			m_actionParam6Description->setText("");
			break;
		case SMART_ACTION_CLOSE_GOSSIP:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_TRIGGER_TIMED_EVENT:
            m_actionParam1Description->setText("id (>1)");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_TIMED_EVENT:
            m_actionParam1Description->setText("id (>1)");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_AURA:
            m_actionParam1Description->setText("spell ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_RESET_SCRIPT_BASE_OBJECT:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_SCRIPT_RESET:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_RANGED_MOVEMENT:
            m_actionParam1Description->setText("attackDistance");
            m_actionParam2Description->setText("attackAngle");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_TIMED_ACTIONLIST:
            m_actionParam1Description->setText("EntryOrGUID");
            m_actionParam2Description->setText("0 OOC, 1 IC, 2 always");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_NPC_FLAG:
            m_actionParam1Description->setText("creature_template.npcflag");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_NPC_FLAG:
            m_actionParam1Description->setText("creature_template.npcflag");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_NPC_FLAG:
            m_actionParam1Description->setText("creature_template.npcflag");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SIMPLE_TALK:
            m_actionParam1Description->setText("creature_text.groupid");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_INVOKER_CAST:
            m_actionParam1Description->setText("spell ID");
            m_actionParam2Description->setText("cast flags");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_CROSS_CAST:
            m_actionParam1Description->setText("spell ID");
            m_actionParam2Description->setText("cast flags");
            m_actionParam3Description->setText("CasterTargetType");
            m_actionParam4Description->setText("CasterTarget (target_param1)");
            m_actionParam5Description->setText("CasterTarget (target_param2)");
            m_actionParam6Description->setText("CasterTarget (target_param3)");
			break;
		case SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST:
            m_actionParam1Description->setText("EntryOrGUID1");
            m_actionParam2Description->setText("EntryOrGUID2");
            m_actionParam3Description->setText("EntryOrGUID3");
            m_actionParam4Description->setText("EntryOrGUID4");
            m_actionParam5Description->setText("EntryOrGUID5");
            m_actionParam6Description->setText("EntryOrGUID6");
			break;
		case SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST:
            m_actionParam1Description->setText("EntryOrGUID min");
            m_actionParam2Description->setText("EntryOrGUID max");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_RANDOM_MOVE:
            m_actionParam1Description->setText("max distance");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_UNIT_FIELD_BYTES_1:
            m_actionParam1Description->setText("value");
            m_actionParam2Description->setText("type");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1:
            m_actionParam1Description->setText("value");
            m_actionParam2Description->setText("type");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_INTERRUPT_SPELL:
            m_actionParam1Description->setText("with delay (0/1)");
            m_actionParam2Description->setText("spell ID");
            m_actionParam3Description->setText("instant (0/1)");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SEND_GO_CUSTOM_ANIM:
            m_actionParam1Description->setText("animprogress (0-255)");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_DYNAMIC_FLAG:
            m_actionParam1Description->setText("dynamic flags");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_DYNAMIC_FLAG:
            m_actionParam1Description->setText("dynamic flags");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_DYNAMIC_FLAG:
            m_actionParam1Description->setText("dynamic flags");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_JUMP_TO_POS:
            m_actionParam1Description->setText("speed XY");
            m_actionParam2Description->setText("speed Z");
            m_actionParam3Description->setText("target X");
            m_actionParam4Description->setText("target Y");
            m_actionParam5Description->setText("target Z");
			m_actionParam6Description->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SEND_GOSSIP_MENU:
            m_actionParam1Description->setText("gossip_menu_option.menuID");
            m_actionParam2Description->setText("gossip_menu_option.npc_text_id");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_GO_SET_LOOT_STATE:
            m_actionParam1Description->setText("0 not ready, 1 ready,\n2 activated, 3 just deactivated");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SEND_TARGET_TO_TARGET:
            m_actionParam1Description->setText("id");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_HOME_POS:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam1->setDisabled(true);
            m_actionParam1->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_HEALTH_REGEN:
            m_actionParam1Description->setText("0/1");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_ROOT:
            m_actionParam1Description->setText("0/1");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_GO_FLAG:
            m_actionParam1Description->setText("gameobject_template.flags");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_GO_FLAG:
            m_actionParam1Description->setText("gameobject_template.flags");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_GO_FLAG:
            m_actionParam1Description->setText("gameobject_template.flags");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam2->setDisabled(true);
            m_actionParam2->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SUMMON_CREATURE_GROUP:
            m_actionParam1Description->setText("creature_summon_groups.groupid");
            m_actionParam2Description->setText("attack invoker (0/1)");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_POWER:
            m_actionParam1Description->setText("power type");
            m_actionParam2Description->setText("new power");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_POWER:
            m_actionParam1Description->setText("power type");
            m_actionParam2Description->setText("amount");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_POWER:	
            m_actionParam1Description->setText("power type");
            m_actionParam2Description->setText("amount to remove");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
            m_actionParam3->setDisabled(true);
            m_actionParam3->setText("");
            m_actionParam4->setDisabled(true);
            m_actionParam4->setText("");
            m_actionParam5->setDisabled(true);
            m_actionParam5->setText("");
            m_actionParam6->setDisabled(true);
            m_actionParam6->setText("");
			break;
    default:
        QMessageBox::critical(0, "Bad shit happened!", "Something terrible happened selecting an action. Please contact Sanity!");
	}
}

void ScriptGenerator::slotTargetChanged(int current){
	m_targetDescription1->setText("");
    m_editTarget1->setDisabled(true);
    m_editTarget1->setText("");
	m_targetDescription2->setText("");
    m_editTarget2->setDisabled(true);
    m_editTarget2->setText("");
	m_targetDescription3->setText("");
    m_editTarget3->setDisabled(true);
    m_editTarget3->setText("");
	m_editTargetX->setText("");
	m_editTargetX->setDisabled(true);
	m_editTargetY->setText("");
	m_editTargetY->setDisabled(true);
	m_editTargetZ->setText("");
	m_editTargetZ->setDisabled(true);
	m_editTargetO->setText("");
	m_editTargetO->setDisabled(true);
	switch(current){
        case SMART_TARGET_NONE:
            break;
        case SMART_TARGET_SELF:
            break;
        case SMART_TARGET_VICTIM:
            break;
        case SMART_TARGET_HOSTILE_SECOND_AGGRO:
            break;
        case SMART_TARGET_HOSTILE_LAST_AGGRO:
            break;
        case SMART_TARGET_HOSTILE_RANDOM:
            break;
        case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP:
            break;
        case SMART_TARGET_ACTION_INVOKER:
            break;
        case SMART_TARGET_POSITION:
            m_targetDescription1->setText("fill in xyzo below");
            m_editTargetX->setEnabled(true);
            m_editTargetY->setEnabled(true);
            m_editTargetZ->setEnabled(true);
            m_editTargetO->setEnabled(true);
            break;
        case SMART_TARGET_CREATURE_RANGE:
            m_targetDescription1->setText("creature entry (0 if any)");
            m_targetDescription2->setText("min range");
            m_targetDescription3->setText("max range");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            m_editTarget3->setEnabled(true);
            break;
        case SMART_TARGET_CREATURE_GUID:
            m_targetDescription1->setText("GUID");
            m_targetDescription2->setText("entry");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            break;
        case SMART_TARGET_CREATURE_DISTANCE:
            m_targetDescription1->setText("creature entry");
            m_targetDescription2->setText("max dist");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            break;
        case SMART_TARGET_STORED:
            m_targetDescription1->setText("ID");
            m_targetDescription2->setText("");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            break;
        case SMART_TARGET_GAMEOBJECT_RANGE:
            m_targetDescription1->setText("GO entry");
            m_targetDescription2->setText("min dist");
            m_targetDescription3->setText("max dist");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            m_editTarget3->setEnabled(true);
            break;
        case SMART_TARGET_GAMEOBJECT_GUID:
            m_targetDescription1->setText("GUID");
            m_targetDescription2->setText("entry");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            break;
        case SMART_TARGET_GAMEOBJECT_DISTANCE:
            m_targetDescription1->setText("GO entry (0 if any)");
            m_targetDescription2->setText("max dist");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            break;
        case SMART_TARGET_INVOKER_PARTY:
            break;
        case SMART_TARGET_PLAYER_RANGE:
            m_targetDescription1->setText("min dist");
            m_targetDescription2->setText("max dist");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            break;
        case SMART_TARGET_PLAYER_DISTANCE:
            m_targetDescription1->setText("max dist");
            m_targetDescription2->setText("");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            break;
        case SMART_TARGET_CLOSEST_CREATURE:
            m_targetDescription1->setText("entry (0 if any)");
            m_targetDescription2->setText("max dist");
            m_targetDescription3->setText("dead? (0/1)");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            m_editTarget3->setEnabled(true);
            break;
        case SMART_TARGET_CLOSEST_GAMEOBJECT:
            m_targetDescription1->setText("GO entry");
            m_targetDescription2->setText("max dist");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            break;
        case SMART_TARGET_CLOSEST_PLAYER:
            m_targetDescription1->setText("max dist");
            m_targetDescription2->setText("");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            break;
        case SMART_TARGET_ACTION_INVOKER_VEHICLE:
            break;
        case SMART_TARGET_OWNER_OR_SUMMONER:
            break;
        case SMART_TARGET_THREAT_LIST:
            break;
        case SMART_TARGET_CLOSEST_ENEMY:
            m_targetDescription1->setText("max dist");
            m_targetDescription2->setText("");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            break;
        case SMART_TARGET_CLOSEST_FRIENDLY:
            m_targetDescription1->setText("max dist");
            m_targetDescription2->setText("");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            break;
        default:
            QMessageBox::critical(0, "Bad shit happened!", "Something terrible happened selecting a target. Please contact Sanity!");
	}
}
